#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
class A
{
public:
	void f()
	{
		cout << " A" << endl;
	}
};
class B :public A
{
public:
	virtual void f()
	{
		cout << "B\n";
	}
};

int main()
{
	A* a = new B;
	a->f();
	delete a;
	return 0;
}